Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
javascript en onclick="return func();" deja de funcionar después del primer elemento por id
<button onclick="return validateEdit();" class="btn btn-primary submit-btn">Submit</button> function validateEdit() { var name = document.getElementById("sftName").value; aler("name") var startTime = document.getElementById("startTimeEdit").value; aler("start time") }

La función ejecuta la primera alerta y no muestra la segunda alerta. También estoy usando:

 $('#edit_shift').on('show.bs.modal', function (event) { var anchor = $(event.relatedTarget) // Button that triggered the modal var id = anchor.data('whatever') var from = anchor.data('fromtime') var modal = $(this) $("#sftName").attr("value", name); $("#startTimeEdit").attr("value", from);

En la otra forma está funcionando bien.

Editar: la hora de inicio con valor y sin valor no funciona en ambos casos.

Estoy completamente a cero en javascript.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Hay algún error tipográfico. Asegúrese de que esté alerta en su código y no alerta . También el contenido html que publicó tiene solo un botón, mientras que está tratando de obtener dos elementos con id sftName y startTimeEdit , asegúrese de que esos elementos estén allí en su código. Para una mejor comprensión, ¿puede recrear el problema anterior en codepen?

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!